#include<iostream>
using namespace std;

int main()
{
	long long m = 0, k = 0, count = 0;
	cin >> m >> k;
	while (m > 0)
	{
		if (m % 10 == 3)
			count++;
		m /= 10;	
	}
	if (count == k)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	
	return 0;
}
